package com.axx.android.utils;

import java.util.Locale;

/**
 * Created by sunjie on 2017/7/23.
 */

public class MapUtils {
    public static String getCity(String code) {
        code = code.substring(0, 4);
        return code + "00";

    }

    public static String getProvince(String code) {
        code = code.substring(0, 2);
        return code + "0000";
    }

    public static String getDistance(int distance) {
        if (distance <= 1000) {
            return String.format(Locale.US, "%.1f公里", (double) distance / 1000);
        } else {
            return String.format(Locale.US, "%.2f公里", (double) distance / 1000);
        }
    }

}
